package com.yunxiang.controller;

import net.sf.json.JSONArray;

import com.jfinal.plugin.activerecord.Db;
import com.yunxiang.base.BaseController;
import com.yunxiang.plugin.SqlManager;

public class StationController extends BaseController{
	public void list(){
		try {
			int page = getParaToInt("page")==null?1:getParaToInt("page");
			int begin = (page-1)*10;
			int end = page*10;
			JSONArray temp = recordListToJsonArray(Db.find(SqlManager.sql("station.station_list"), 
					new Object[]{getPara("keyWord"),getPara("keyWord"),
				                 getPara("keyWord"),begin,end}));
			System.out.println("页面大小"+temp.size());
			renderTempletJson(true, "success", temp);
		} catch (Exception e) {
			e.printStackTrace();
			renderTempletJson(false, "exception", "");
		}
		
		
	}
}
